home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / GAMETEST.PAS < prev    next >
Pascal/Delphi Source File  |  1988-08-01  |  2KB  |  44 lines

  1. {--------------------------------------------------------------}
  2. {                          GAMETEST                            }
  3. {                                                              }
  4. {         Machine-code joystick support demo program           }
  5. {                                                              }
  6. {                             by Jeff Duntemann                }
  7. {                             Turbo Pascal V5.00               }
  8. {                             Last update 8/1/88               }
  9. {                                                              }
  10. { Nothing complex here.  This program USES the GAMEBORD unit,  }
  11. { that contains two assembly-language routines for reading     }
  12. { either of the two joysticks and their associated buttons.    }
  13. { The program polls the stick continually and reports the      }
  14. { status of the buttons and the current coordinates of the     }
  15. { joystick.  To end the program, press any key.                }
  16. {                                                              }
  17. {     From: COMPLETE TURBO PASCAL 5.0  by Jeff Duntemann       }
  18. {    Scott, Foresman & Co., Inc. 1988   ISBN 0-673-38355-5     }
  19. {--------------------------------------------------------------}
  20.  
  21. PROGRAM GameTest;
  22.  
  23. USES Crt,Gamebord;
  24.  
  25. VAR
  26.   X,Y : INTEGER;
  27.  
  28. BEGIN
  29.   ClrScr;
  30.   X := 0; Y := 0;
  31.   GotoXY(2,9); Writeln('X Axis   Y Axis');
  32.   WHILE NOT KeyPressed DO
  33.     BEGIN
  34.       GotoXY(1,5);
  35.       IF Button(2,1) THEN Writeln('Button 1 pressed!')
  36.         ELSE Writeln('Nothing on 1.....');
  37.       IF Button(2,2) THEN Writeln('Button 2 pressed!')
  38.         ELSE Writeln('Nothing on 2.....');
  39.       Stick(2,X,Y);
  40.       GotoXY(1,10);
  41.       Writeln(X:5,'   ',Y:5);
  42.     END;
  43. END.
  44.